import request from './request'
/**
 * 获取角色列表
 * 
 */
export const getRoles = () => request.get("roles")
    /**
     * 添加修改删除角色
     */
export const addrRoles = (model) => request.post("roles", model)
export const editRoles = (model) => request.put(`roles/${model.id}`, model)
export const deleteRoles = (id) => request.delete(`roles/${id}`)

/**
 * 修改用户列表
 */
export const updateroles = (id, rid) => request.put(`users/${id}/role`, { rid });
/*
 *获取树形菜单
 */
export const getMenuTree = () => request.get('rights/tree')
    /**
     * 分配权限
     */
export const assignRights = (id, rids) => request.post(`roles/${id}/rights`, { rids })